//
//  SwiftChar.swift
//  swiftStudy
//
//  Created by unisedu on 16/4/1.
//  Copyright © 2016年 CaoFei. All rights reserved.
//

import UIKit
/**
 char类型
 */
class SwiftChar: NSObject {
    
    func show(){
        //获取字符串中的每一个字符
        let strValue = "获取字符串中的每一个字符"
        for c in strValue.characters
        {
            print("<", String(c), ">")
            
        }
        
        
        //生命自负类型变量／常量
        let charValue1:Character = "a"
        let charValue2:Character = "上"
        debugPrint(charValue1,charValue2)
        
        //全局函数countElements与获取字符个数
        
        print(strValue.characters.count)
        
        //字符和字符串也可以连接 2.0不行了
        let strValue2 = "abcd"
        let charValue3:Character = "e"
        let strValue3 = strValue2 + String(charValue3)
        debugPrint(strValue3)
        //获取Unicode 字符的编码
        let strValue4 = "abcd上做下又"
        for c in strValue4.unicodeScalars
        {
            print("\(c.value)")
        }
        print("")

    }
}
